package org.aeon.message.response;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.aeon.message.Message;

import java.io.Serial;

/**
 * @author: MissingAeon
 * @date: 2024/1/25 11:30
 * @description: 响应消息抽象
 */

@Getter
@Setter
@ToString
@NoArgsConstructor
public abstract class ResponseMessage extends Message {
    @Serial
    private static final long serialVersionUID = -5900423242743389775L;
    protected boolean success;
    protected String reason;
    private String responseID;

    public ResponseMessage(String responseID) {
        this.responseID = responseID;
    }

    public void setResponse(boolean success, String reason, String responseID) {
        this.success = success;
        this.reason = reason;
        this.responseID = responseID;
    }

    public void setResponse(boolean success, String reason) {
        this.success = success;
        this.reason = reason;
    }
}
